package hoaitt.edu.vnu.problem3;

public class PrimeMaxOfANumber {
	
	
	private int NumberOfDivisors(int number) {
		int nod = 0;
		int sqrt = (int) Math.Sqrt(number);
 
		for(int i = 1; i<= sqrt; i++){
			if(number % i == 0){
				nod += 2; (o day + 2 la vi A = x . y (x < can A thi y > can A => ton tai Y trong khoang do nen chia het)
			}
		}
		//Correction if the number is a perfect square
		if (sqrt * sqrt == number) {
			nod--;
		}
 
		return nod;
	}
	
	void primeOfANumber(int number) {
		int i = 2;
		while (i <= number) {
			if ((number % i) == 0) {
				System.out.println(i);
				number = number / i;
				// day phai kiem tra la so nguyen to hay ko, thi thang tren kia moi dung can bac 2 duoc :v
			} else {
				i = i + 1;
			}
		}		
	}
	
	public static void main(String args[]) {
		PrimeMaxOfANumber test = new PrimeMaxOfANumber();
		
		test.primeOfANumber(13195);
	}

}
